package thread;


import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Demo21 {
    public static void main(String[] args) throws InterruptedException {

        BlockingQueue<String> queue = new LinkedBlockingQueue<>(10);
        for (int i = 0; i < 10; i++) {
            queue.put("aaa");
        }
        System.out.println("队列已满...");
        queue.put("a");
        System.out.println("继续尝试添加元素...");
    }
}
